/******************************************************************************
 * Copyright (C) 2017 Chengdu Dlhd information industry co. LTD.
 * All Rights Reserved.
 * 本软件为成都顶联互动信息产业有限公司开发研制。未经本公司正式书面同意，其他任何个人、团体不得使用、复制、修改或发布本软件.
 *****************************************************************************/
package net.dgg.dggcloud.service.jrcrm.service.business;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import net.dgg.dggcloud.service.common.base.service.BaseService;
import net.dgg.dggcloud.service.jrcrm.dao.business.BusinessDao;
import net.dgg.dggcloud.service.jrcrm.entity.business.BusinessDx;

/**
 * @ClassName 〈GroupService>
 * @Description
 * @Author 杜倩
 * @Date 2018/3/28 11:42
 */
@Service
public class BusinessDxService extends BaseService {

	@Resource
	private BusinessDao businessDao;

	/**
	 * 保存掉电销次数
	 *
	 */
	public void saveOrUpdate(BusinessDx businessDx) {
		repository.saveOrUpdate(businessDx);

	}

	/**
	 * 保存掉电销次数
	 *
	 */
	public BusinessDx get(Long id) {
		return repository.get(BusinessDx.class, id);
	}

	/**
	 * 根据id获取电销记录
	 * 
	 * @param id
	 * @return
	 */
	public List<Map> getDxRecordByBusinessId(Long id, String recordType) {
		Map map = new HashMap<>();
		map.put("id", id);
		map.put("recordType", recordType);
		return businessDao.listDxAllotRecordByMap(map);
	}

}
